using System.Data;
using Chaotic.DataBase.DataAccess;
using Chaotic.DataBase.DBAccessLibrary.Model;

namespace Chaotic.DataBase.DBAccessLibrary.Interface;

public interface IGrammar
{
	string GetChTableSql { get; }

	string? IsExistChTableSql { get; }

	string? AddColumn(FieldEntity? filed);

	IEnumerable<string?> EditColumn(FieldEntity? filed);

	IEnumerable<string?> RemoveColumn(FieldEntity field);

	IEnumerable<string> EditPrimary(TableEntity table);

	string SelectTop(TableEntity table, int count);

	string SelectAll(TableEntity table);

	string AppendTabText(string text);

	string GetErrorInfo(string errorMsg);

	string? GetProcParamInfo(ProcEntity entity);

	string GetCreateInfo(DatabaseType targetType, TableEntity entity);

	bool GetExecProcInfo(string sql, out string procName, out List<DBParam>? paramlist);

	string GetDataSetToInsertSql(string sql, DataSet? ds, Func<string, bool?> dbTypeAction, out string tableName);

	string GetPageingSql(string sql, decimal index, decimal count);

	void SaveChange(TableEntity table, IList<FieldEntity?> newList, Action<string, int> WriteLog, Func<string, bool> showMsg);

    List<ExecSqlModel> SubmitDataChange(DataSet ds, string tableName);
}
